﻿using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;

namespace UniRx
{
	// Token: 0x02000408 RID: 1032
	[StructLayout(LayoutKind.Sequential, Size = 1)]
	public struct CollectionReplaceEvent<T> : IEquatable<CollectionReplaceEvent<T>>
	{
		// Token: 0x06001521 RID: 5409 RVA: 0x0005EAC7 File Offset: 0x0005CEC7
		public CollectionReplaceEvent(int index, T oldValue, T newValue)
		{
			this = default(CollectionReplaceEvent<T>);
			this.Index = index;
			this.OldValue = oldValue;
			this.NewValue = newValue;
		}

		// Token: 0x17000191 RID: 401
		// (get) Token: 0x06001522 RID: 5410 RVA: 0x0005EAE5 File Offset: 0x0005CEE5
		// (set) Token: 0x06001523 RID: 5411 RVA: 0x0005EAED File Offset: 0x0005CEED
		public int Index { get; private set; }

		// Token: 0x17000192 RID: 402
		// (get) Token: 0x06001524 RID: 5412 RVA: 0x0005EAF6 File Offset: 0x0005CEF6
		// (set) Token: 0x06001525 RID: 5413 RVA: 0x0005EAFE File Offset: 0x0005CEFE
		public T OldValue { get; private set; }

		// Token: 0x17000193 RID: 403
		// (get) Token: 0x06001526 RID: 5414 RVA: 0x0005EB07 File Offset: 0x0005CF07
		// (set) Token: 0x06001527 RID: 5415 RVA: 0x0005EB0F File Offset: 0x0005CF0F
		public T NewValue { get; private set; }

		// Token: 0x06001528 RID: 5416 RVA: 0x0005EB18 File Offset: 0x0005CF18
		public override string ToString()
		{
			return string.Format("Index:{0} OldValue:{1} NewValue:{2}", this.Index, this.OldValue, this.NewValue);
		}

		// Token: 0x06001529 RID: 5417 RVA: 0x0005EB48 File Offset: 0x0005CF48
		public override int GetHashCode()
		{
			return this.Index.GetHashCode() ^ EqualityComparer<T>.Default.GetHashCode(this.OldValue) << 2 ^ EqualityComparer<T>.Default.GetHashCode(this.NewValue) >> 2;
		}

		// Token: 0x0600152A RID: 5418 RVA: 0x0005EB90 File Offset: 0x0005CF90
		public bool Equals(CollectionReplaceEvent<T> other)
		{
			return this.Index.Equals(other.Index) && EqualityComparer<T>.Default.Equals(this.OldValue, other.OldValue) && EqualityComparer<T>.Default.Equals(this.NewValue, other.NewValue);
		}
	}
}
